package com.share.bigdata.phoenix.web;

import com.share.bigdata.phoenix.service.IDataLogService;
import com.share.bigdata.phoenix.service.ITestHbaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-04-29
 */
@Slf4j
@RestController
public class DataLogController {
    @Autowired
    private IDataLogService iDataLogService;

    @Autowired
    private ITestHbaseService testHbaseService;

    @RequestMapping("/mysql/count")
    public Object mysqlCount() {
        long count = iDataLogService.count();
        log.info("查询到数据条数={}", count);
        return count;
    }

    @RequestMapping("/hbase/count")
    public Object hbaseCount() {
        long count = testHbaseService.count();
        log.info("查询到数据条数={}", count);
        return count;
    }

}
